module.exports = app => {
  const { STRING, INTEGER } = app.Sequelize;
  const Book = app.model.define(
    'book',
    {
      id: { type: INTEGER, primaryKey: true, autoIncrement: true },
      bookTitle: STRING(255),
      bookContent: STRING(255),
      bookType: INTEGER,
      bookAuthor: STRING(255),
      bookImage: STRING(255),
    },
    {
      freezeTableName: true, // 强执修改数据表名为model名，不采用默认的复数形式
    }
  );
  return Book;
};
